<script setup>
let xhr = new XMLHttpRequest();

const url = "http://39.98.123.211:8510/api/cms/banner"

xhr.open("GET", url)

xhr.onreadystatechange = function () {
  // console.log(" 网络请求状态：");
  // console.log(xhr.readyState);

  if (xhr.readyState === 4) {
    if (xhr.status >= 200 && xhr.status < 300) {
      let result = JSON.parse(xhr.responseText);
      console.log(result);
    }
    else {
      console.log("请求失败: " + xhr.statusText);
    }
  }

}

xhr.send()
</script>

<template>
  <h1>原生网络请求</h1>
</template>

<style scoped>

</style>